package edu.nf.relaxenjoy.common.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author zhu
 * @date 2024-12-19
 */
@Data
@NoArgsConstructor
public class IPage<T> {

    /**
     * 当前页数据
     */
    private List<T> records;
    /**
     * 总记录数
     */
    private long total;
    /**
     * 当前页码
     */
    private long pageNum;
    /**
     * 每页大小
     */
    private long pageSize;

    public IPage(List<T> records, long total, long pageNum, long pageSize) {
        this.records = records;
        this.total = total;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getPageNum() {
        return pageNum;
    }

    public void setPageNum(long pageNum) {
        this.pageNum = pageNum;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }
}
